///////////////////////////////////////////////////////////////////////////////
////  (c) Chaichuk AU (chaichuk@mail.ru), 								   ////
////  2004, Chelyabinsk, NTC Privodnaya Tehnika (momentum@chel.surnet.ru)  ////
///////////////////////////////////////////////////////////////////////////////

/* CwGauge.h - widget header file */
#ifndef __CWGAUGE_H_
#define __CWGAUGE_H_

#include <Pt.h>

/* widget resources */

#define GAUGE_ARG_POS				Pt_RESOURCE (Pt_USER (1), 0)
#define GAUGE_ARG_MIN				Pt_RESOURCE (Pt_USER (1), 1)
#define GAUGE_ARG_MAX				Pt_RESOURCE (Pt_USER (1), 2)

#define GAUGE_ARG_NDIV				Pt_RESOURCE (Pt_USER (1), 10)
#define GAUGE_ARG_NSUBDIV			Pt_RESOURCE (Pt_USER (1), 11)
#define GAUGE_ARG_STRFMT			Pt_RESOURCE (Pt_USER (1), 12)

#define GAUGE_ARG_ZONES				Pt_RESOURCE (Pt_USER (1), 20)


typedef struct zone_s {
	PgColor_t	color;
	double		min;
	double		max;
} zone_t;	

/* widget instance structure */
typedef struct cw_gauge_widget{
	PtBasicWidget_t	basic;	
	
	double	min;
	double	max;
	double	pos;
	int		n_div;
	int		n_subdiv;
	char	*str_fmt;

	int		n_zone;
	zone_t	*zone;
	
}	CwGaugeWidget_t;

/* widget class pointer */
extern PtWidgetClassRef_t *CwGauge;

#endif //__CWGAUGE_H_